<?php

namespace app\api\model;

use think\Model;


class ResumeModel extends Model
{



    // 表名
    protected $table = 'gx_resume';
    protected $hidden = ['job_id','position_id','qualifications_id'];
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function JobList()
    {
        return $this->hasMany(JobModel::class,'id','job_id')->field('id,name');
    }

    public function PositionList()
    {
        return $this->hasMany(PositionModel::class,'id','position_id')->field('id,name');
    }
    public function EnterpriseList()
    {
        return $this->hasMany(EnterpriseModel::class,'id','enterprise_id')->field('id,name');
    }

    public function QualificationsList()
    {
        return $this->hasMany(QualificationsModel::class,'id','qualifications_id')->field('id,name');
    }



    public function  qualificationsDate()
    {
        return $this->belongsTo(QualificationsModel::class, 'qualifications_id', 'id', [], 'LEFT')->field('id,name');
    }




    public function user()
    {
        return $this->belongsTo('app\admin\model\gx\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function qualifications()
    {
        return $this->belongsTo('app\admin\model\gx\Qualifications', 'qualifications_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function position()
    {
        return $this->belongsTo('app\admin\model\gx\Position', 'position_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function work()
    {
        return $this->belongsTo('app\admin\model\gx\Work', 'work_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function education()
    {
        return $this->belongsTo('app\admin\model\gx\Education', 'education_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function job()
    {
        return $this->belongsTo('app\admin\model\gx\Job', 'job_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}